﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ares.Controller;
using Ares.Engine;
using Ares.GUI.Models;

namespace Ares.GUI.Controller
{
    class RevertProjectController : BaseController
    {
        private List<BackupProtocol> allVersions;

        public BackupProject CurrentProject;
        public List<BackupProtocol> AllVersions
        {
            get
            {
                return allVersions;
            }
            set
            {
                allVersions = value;
                OnPropertyChanged("AllVersions");
            }
        }
        public RevertProjectController()
        {
            Mediator.Register(this, new[] { 
                Messages.RevertProject
            });
        }

        public override void MessageNotification(string message, object args)
        {
            switch (message)
            {
                case Messages.RevertProject:
                    if (args != null)
                    {
                        CurrentProject = ((BackupContainer)args).Project;
                        AllVersions = ((BackupContainer)args).BackupClass.GetAllProtocols();
                    }
                    break;
            }
        }
    }
}
